package sword2offer;

import java.util.HashSet;
import java.util.Set;

public class Offer003 {
    public int findRepeatNumber(int[] nums) {
        Set<Integer>set=new HashSet<>();
        for (int i = 0; i < nums.length; i++) {
            int num=nums[i];
            if (set.contains(num))return num;
            set.add(num);
        }
        return 0;
    }
}
